<?php
/**
 * Адаптер библиотеки W3xmlrpcClient использующий file_get_contents
 *
 * @author Evgeny Blinov <e.a.blinov@gmail.com>
 * @license New BSD License
 * @link http://code.google.com/p/w3lib/
 * @package W3xmlrpcClient
 * @version $Id: W3xmlrpcAdapterInternal.php 4 2011-10-17 23:48:11Z E.A.Blinov@gmail.com $
 */

class W3xmlrpcAdapterInternal implements _W3xmlrpcAdapter{
    public function request($url, $request) {
        $context = stream_context_create(array(
            'http' => array(
                'method' => 'POST',
                'content' => $request,
                'header' => "Content-Type: text/xml\r\nContent-Length: ".  strlen($request)."\r\n",
                'user_agent' => W3xmlrpcClient::UA.' (Adapter '.__CLASS__.')'
            )
        ));
        return file_get_contents($url, false, $context);
    }
}